package com.github.shiqiyue.app.api.sapi.controller.dbms.dto;

import com.github.shiqiyue.app.modules.dbms.entity.UserSqlCollect;
import lombok.Data;

import java.util.Date;
import java.util.List;

/***
 * 用户收藏的SQL列表 DTO
 * @author wenyao.wu
 * @date 2019/8/12
 */
@Data
public class UserSqlCollectListDTO {

    private List<Item> records;


    @Data
    public static class Item {

        private Long id;

        private String sql;

        private String name;

        private Date addDate;

        private Item() {
        }

        public static Item newInstance(UserSqlCollect data) {
            Item item = new Item();
            item.setId(data.getId());
            item.setSql(data.getData());
            item.setName(data.getName());
            item.setAddDate(data.getAddDate());
            return item;
        }

    }

}
